package com.columboid.protocol.syncml.devicemgmt;

/**
 * Schema fragment(s) for this class:
 * 
 * <pre>
 * &lt;xs:element xmlns:ns=&quot;http://protocol.columboid.com/syncml/devicemgmt&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; name=&quot;DFFormat&quot;&gt;
 *   &lt;xs:complexType&gt;
 *     &lt;xs:choice&gt;
 *       &lt;xs:element ref=&quot;ns:b64&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:bool&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:chr&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:int&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:node&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:null&quot;/&gt;
 *       &lt;xs:element ref=&quot;ns:xml&quot;/&gt;
 *     &lt;/xs:choice&gt;
 *   &lt;/xs:complexType&gt;
 * &lt;/xs:element&gt;
 * </pre>
 */
public class DFFormat {
	private int DFFormatSelect = -1;
	private static final int B64_CHOICE = 0;
	private static final int BOOL_CHOICE = 1;
	private static final int CHR_CHOICE = 2;
	private static final int INT_CHOICE = 3;
	private static final int NODE_CHOICE = 4;
	private static final int NULL_CHOICE = 5;
	private static final int XML_CHOICE = 6;
	private B64 b64;
	private Bool bool;
	private Chr chr;
	private Int _int;
	private Node1 node;
	private Null _null;
	private Xml xml;

	private void setDFFormatSelect(int choice) {
		if (DFFormatSelect == -1) {
			DFFormatSelect = choice;
		} else if (DFFormatSelect != choice) {
			throw new IllegalStateException(
					"Need to call clearDFFormatSelect() before changing existing choice");
		}
	}

	/**
	 * Clear the choice selection.
	 */
	public void clearDFFormatSelect() {
		DFFormatSelect = -1;
	}

	/**
	 * Check if B64 is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifB64() {
		return DFFormatSelect == B64_CHOICE;
	}

	/**
	 * Get the 'b64' element value.
	 * 
	 * @return value
	 */
	public B64 getB64() {
		return b64;
	}

	/**
	 * Set the 'b64' element value.
	 * 
	 * @param b64
	 */
	public void setB64(B64 b64) {
		setDFFormatSelect(B64_CHOICE);
		this.b64 = b64;
	}

	/**
	 * Check if Bool is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifBool() {
		return DFFormatSelect == BOOL_CHOICE;
	}

	/**
	 * Get the 'bool' element value.
	 * 
	 * @return value
	 */
	public Bool getBool() {
		return bool;
	}

	/**
	 * Set the 'bool' element value.
	 * 
	 * @param bool
	 */
	public void setBool(Bool bool) {
		setDFFormatSelect(BOOL_CHOICE);
		this.bool = bool;
	}

	/**
	 * Check if Chr is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifChr() {
		return DFFormatSelect == CHR_CHOICE;
	}

	/**
	 * Get the 'chr' element value.
	 * 
	 * @return value
	 */
	public Chr getChr() {
		return chr;
	}

	/**
	 * Set the 'chr' element value.
	 * 
	 * @param chr
	 */
	public void setChr(Chr chr) {
		setDFFormatSelect(CHR_CHOICE);
		this.chr = chr;
	}

	/**
	 * Check if Int is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifInt() {
		return DFFormatSelect == INT_CHOICE;
	}

	/**
	 * Get the 'int' element value.
	 * 
	 * @return value
	 */
	public Int getInt() {
		return _int;
	}

	/**
	 * Set the 'int' element value.
	 * 
	 * @param _int
	 */
	public void setInt(Int _int) {
		setDFFormatSelect(INT_CHOICE);
		this._int = _int;
	}

	/**
	 * Check if Node is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifNode() {
		return DFFormatSelect == NODE_CHOICE;
	}

	/**
	 * Get the 'node' element value.
	 * 
	 * @return value
	 */
	public Node1 getNode() {
		return node;
	}

	/**
	 * Set the 'node' element value.
	 * 
	 * @param node
	 */
	public void setNode(Node1 node) {
		setDFFormatSelect(NODE_CHOICE);
		this.node = node;
	}

	/**
	 * Check if Null is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifNull() {
		return DFFormatSelect == NULL_CHOICE;
	}

	/**
	 * Get the 'null' element value.
	 * 
	 * @return value
	 */
	public Null getNull() {
		return _null;
	}

	/**
	 * Set the 'null' element value.
	 * 
	 * @param _null
	 */
	public void setNull(Null _null) {
		setDFFormatSelect(NULL_CHOICE);
		this._null = _null;
	}

	/**
	 * Check if Xml is current selection for choice.
	 * 
	 * @return <code>true</code> if selection, <code>false</code> if not
	 */
	public boolean ifXml() {
		return DFFormatSelect == XML_CHOICE;
	}

	/**
	 * Get the 'xml' element value.
	 * 
	 * @return value
	 */
	public Xml getXml() {
		return xml;
	}

	/**
	 * Set the 'xml' element value.
	 * 
	 * @param xml
	 */
	public void setXml(Xml xml) {
		setDFFormatSelect(XML_CHOICE);
		this.xml = xml;
	}
}
